<a href='https://github.com/angular/angular.js/edit/v1.2.x/src/ngCookies/cookies.js?message=docs($cookies)%3A%20describe%20your%20change...#L21' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.2.28/src/ngCookies/cookies.js#L21' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">$cookies</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
  

    <li>
      - service in module <a href="api/ngCookies">ngCookies</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>Provides read/write access to browser&#39;s cookies.</p>
<p>Only a simple Object is exposed and by adding or removing properties to/from this object, new
cookies are created/deleted at the end of current $eval.
The object&#39;s properties can only be strings.</p>
<p>Requires the <a href="api/ngCookies"><code>ngCookies</code></a> module to be installed.</p>

</div>




<div>
  

    

  

  
  
  



  
  <h2 id="example">Example</h2><pre><code class="lang-js">angular.module(&#39;cookiesExample&#39;, [&#39;ngCookies&#39;])
.controller(&#39;ExampleController&#39;, [&#39;$cookies&#39;, function($cookies) {
  // Retrieving a cookie
  var favoriteCookie = $cookies.myFavorite;
  // Setting a cookie
  $cookies.myFavorite = &#39;oatmeal&#39;;
}]);
</code></pre>

</div>


